#ifndef NOSAL_EXEC_INTERNAL_CONFIG_MACHINE_MANIFEST_H_
#define NOSAL_EXEC_INTERNAL_CONFIG_MACHINE_MANIFEST_H_

#include "state.h"
#include "enter_exit_timeout.h"

#include <vector>
#include <string>

namespace netaos {
namespace nosal {
namespace exec {
namespace internal {
namespace config {

extern const char kStateOff[];
extern const char kStateMachineStartup[];
extern const char kStateMachineShutdown[];
extern const char kStateMachineRestart[];

///
/// @brief FunctionGroup represents a Function Group configuration.
///
struct FunctionGroup final
{
    const std::string& GetName() const noexcept
    {
        return name_;
    }
    const std::vector<State>& GetStates() const noexcept
    {
        return states_;
    }

    std::string name_;
    std::vector<State> states_;
};

///
/// @brief ResourceGroup represents a ResourceG Group configuration.
///
struct ResourceGroup final
{
    const std::string& GetName() const noexcept
    {
        return name_;
    }
    std::uint32_t GetCpuUsage() const noexcept
    {
        return cpu_usage_;
    }
    std::uint32_t GetMemUsage() const noexcept
    {
        return mem_usage_;
    }

    std::string name_;
    std::uint32_t cpu_usage_;
    std::uint32_t mem_usage_;
};
///
/// @brief MachineManifest represents a Machine Manifest.
///
class MachineManifest final
{
public:
    explicit MachineManifest(std::string manifestPath);

    const std::vector<State>& GetMachineStates() const
    {
        return machine_states_;
    }
    const std::vector<FunctionGroup>& GetFunctionGroups() const
    {
        return function_groups_;
    }
    const std::vector<ResourceGroup>& GetResourceGroups() const
    {
        return resource_groups_;
    }
    const EnterExitTimeout& GetDefaultProcessTimeout() const
    {
        return default_process_timeout_;
    }

    const std::vector<std::string> GetEnvironmentVariables() const
    {
        return environment_variables_;
    }

private:
    std::vector<State> machine_states_;
    std::vector<FunctionGroup> function_groups_;
    std::vector<ResourceGroup> resource_groups_;
    EnterExitTimeout default_process_timeout_;
    std::vector<std::string> environment_variables_;
};

}  // namespace config
}  // namespace internal
}  // namespace exec
}  // namespace nosal
}  // namespace netaos

#endif  // NOSAL_EXEC_INTERNAL_CONFIG_MACHINE_MANIFEST_H_
